import { request } from "@/utils/request";
import { ApiResponse } from "./types";

//获取所有数据
export const GetJobTitle = (): Promise<ApiResponse> => {
    return request({
        url: `/api/JobTitle`,
        method: 'get'
    })
}

//分页获取数据
export const GetJobTitleByPage = (page: number, size: number): Promise<ApiResponse> => {
    return request({
        url: `/api/JobTitle/page`,
        method: 'get',
        params: {
            page: page,
            size: size
        }
    })
}

//新增数据
export const PostJobTitle = (data: any): Promise<ApiResponse> => {
    return request({
        url: `/api/JobTitle`,
        method: 'post',
        data: data
    })
}

//修改数据
export const PutJobTitle = (id: number, data: any): Promise<ApiResponse> => {
    return request({
        url: `/api/JobTitle/${id}`,
        method: 'put',
        data: data
    })
}

//删除数据
export const DeleteJobTitle = (id: number): Promise<ApiResponse> => {
    return request({
        url: `/api/JobTitle/${id}`,
        method: 'delete'
    })
}